import request from '../../utils/request'

export const noticesApi = {
  // 获取列表
  getList(params) {
    return request({
      url: '/notices/list',
      method: 'get',
      params
    })
  },

  // 创建
  create(data) {
    return request({
      url: '/notices/',
      method: 'post',
      data
    })
  },

  // 更新
  update(data) {
    return request({
      url: '/notices/',
      method: 'put',
      data
    })
  },

  // 删除
  delete(id) {
    return request({
      url: `/notices/remove/${id}`,
      method: 'delete'
    })
  },

  // 批量删除
  batchDelete(ids) {
    return request({
      url: '/notices/remove/batch',
      method: 'delete',
      data: ids
    })
  },

  // 获取详情
  getInfo(id) {
    return request({
      url: `/notices/${id}`,
      method: 'get'
    })
  }
}
